package cn.tedu.reflection;

/**
 * @author :Colin
 * @version 创建时间: 2021/6/24 16:12
 * 本类用于反射先准备的物料类
 */
public class Student {
    public static void main(String[] args) {
        method();
        new Student().method();
        char s []={'h','l'} ;
        String a="hl";
        String t=new String("hl");

        System.out.println(s.toString());
        System.out.println(t.equals(a));

    }

    private static void method() {
    }

    //1.定义成员变量
    String name;
    int age;

    //2.定义构造方法
    public Student(){//注意手动添加无参构造，防止被后续添加的含参构造覆盖

    }

    public Student(String name, int age) {
        int a;
        this.name = name;
        this.age = age;

    }
    public void eat(){

        System.out.println("坚持住，马上吃饭");
        this.play(1);
    }
    public int play(int n){
        System.out.println("今天我要玩"+n+":个小时代码");
        return n;
    }
}
class pupil extends Student{

    public int play(int a)
    {return 0;}
}